: <> generated: 2023-Feb-20 15:34:24
: <> family: CaV
: <> type: HodgkinHuxleyAlphaBeta
: <> model: Eyring
: <> institution: EPFL
: <> lab: BBP
: <> host_cell: CHO_FT
: <> ion_channel: Cav3.3_cop
: <> species: Mouse
: <> temp: 25

NEURON {
    SUFFIX Cav3_3
    USEION ca READ eca WRITE ica
    RANGE gca, ica, gcabar
}

: ========== VARIABLES ==========

UNITS {
    (S) = (siemens)
    (mV) = (millivolt)
    (mA) = (milliamp)
}

PARAMETER {
    gcabar = 1.615356e+00 (S / cm2)
    P01 = 3.235068e-01 (1 / ms)
    P02 = 8.932180e-02 (1 / mV)
    P03 = 2.094171e+01 (mV)
    P04 = 1.343764e-03 (1 / ms)
    P05 = 6.034884e-02 (1 / mV)
    P06 = 1.890455e-02 (1 / ms)
    P07 = 1.265853e-01 (1 / mV)
    P08 = 5.265239e+01 (mV)
    P09 = 7.467151e-05 (1 / ms)
    P10 = 3.849902e-02 (1 / mV)
}

ASSIGNED {
    v (mV)
    eca (mV)
    ica (mA / cm2)
    gca (S / cm2)
    m_inf
    h_inf
    m_tau (ms)
    h_tau (ms)
}

: ========== FUNCTION DEFINITIONS ==========

FUNCTION mAlpha (vm (mV)) (1 / ms) {
    mAlpha = P01 / (1 + exp(-P02 * (vm + P03)))
}

FUNCTION mBeta (vm (mV)) (1 / ms) {
    mBeta = P04 * exp(-P05 * vm)
}

FUNCTION hAlpha (vm (mV)) (1 / ms) {
    hAlpha = P06 / (1 + exp(-P07 * (vm + P08)))
}

FUNCTION hBeta (vm (mV)) (1 / ms) {
    hBeta = P09 * exp(-P10 * vm)
}

FUNCTION mTau (vm (mV)) (ms) {
    mTau = 1 / (mAlpha(vm) + mBeta(vm))
}

FUNCTION hTau (vm (mV)) (ms) {
    hTau = 1 / (hAlpha(vm) + hBeta(vm))
}

FUNCTION mInf (vm (mV)) {
    mInf = mAlpha(vm) * mTau(vm)
}

FUNCTION hInf (vm (mV)) {
    hInf = hBeta(vm) * hTau(vm)
}

PROCEDURE rates() {
    m_tau = mTau(v)
    h_tau = hTau(v)
    m_inf = mInf(v)
    h_inf = hInf(v)
}

: ========== PROGRAM ==========

STATE {
    m
    h
}

INITIAL {
    rates()
    m = m_inf
    h = h_inf
}

BREAKPOINT {
    SOLVE states METHOD cnexp
    gca = gcabar * m * m * h
    ica = gca * (v - eca)
}

DERIVATIVE states {
    rates()
    m' = (m_inf  - m) / m_tau
    h' = (h_inf  - h) / h_tau
}
